package net.lazyandroid.namewars.ui;

import android.content.Context;
import android.content.DialogInterface;
import android.preference.DialogPreference;
import android.util.AttributeSet;

public class MyDialogPreference extends DialogPreference {
    Listener mListener;
    public MyDialogPreference(Context context, AttributeSet attrs) {
        super(context,attrs);
    }
 
    public void	onClick(DialogInterface dialog, int which) {
        System.out.println("MyDialogPreference CLICKED: " + which);
        if (mListener != null) {
            mListener.onClick(this, which);
        }
    }

    public void setListener(Listener listener) 
    {
        mListener = listener;
    }

    public interface Listener {
        public void onClick(MyDialogPreference dialog, int which);
    }
}
